import java.util.Scanner;

public class Test2 {
    public static void main2(String[] args) {
        firstUiqueChar();
    }
    public static int firstUiqueChar() {
        //找到字符串第一个出现一次的字符
        Scanner scanner = new Scanner(System.in);
        System.out.print("输入：s = ");
        String s = scanner.next();

        int[] count = new int[26];
        for(int i = 0; i < s.length(); i++) {
            char tmp = s.charAt(i);
            count[tmp - 97]++;
        }

        //遍历数组，找到第一个值为 1的元素并返回其下标
        for(int i = 0; i < s.length(); i++) {
            char tmp = s.charAt(i);
            if(count[tmp - 97] == 1) {
                System.out.println("输出：" + s.indexOf(tmp));
                return s.indexOf(tmp);
            }
        }

        //字符串中没有唯一字符
        System.out.println("输出：" + -1);
        return -1;

    }

    public static void main1(String[] args) {
        char ch = 'a';
        //int num = ch - 97; //0  char 转为 int
        int num = ch - 'a';

        char ch2 = '1';
        int num2 = ch2 - '0'; //1
        int num3 = ch2 - 0; //49

    }

    public static void findLast() {
        //最后一个单词的长度
        Scanner scanner = new Scanner(System.in);
        String str = scanner.next();

        int flag = str.lastIndexOf(' ');
        int lastLength = str.length() - 1 - flag;
        System.out.println(lastLength);
    }
    public static void main3(String[] args) {
        findLast();
    }


}
